cmake_minimum_required(VERSION 3.20)
project(ProxyDemo VERSION 1.0.0 LANGUAGES CXX)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)


# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# 设置构建类型
if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Release)
endif()

# 添加编译器警告
if(MSVC)
    add_compile_options(/W4 /permissive-)
else()
    add_compile_options(-Wall -Wextra -Wpedantic)
endif()

set(my_EXE proxy_demo)

# 创建主可执行文件
add_executable(${my_EXE}
    main.cpp
    examples/basic_usage.cpp
    examples/polymorphism.cpp
    examples/formatting.cpp
    examples/streaming.cpp
    examples/advanced_features.cpp
    
    include/utils.h
)

## header-only
##target_link_libraries(${my_EXE} PRIVATE msft_proxy4::proxy)

# 设置包含目录
target_include_directories(${my_EXE}
    PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/include
)

# 设置输出目录
set_target_properties(${my_EXE} PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)